<!-- 横向滚动 -->
<style>
  main{
    display: flex;
    overflow: scroll;
    scroll-timeline: --scrollcontainer inline;
  }
  main>span {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background-color: #F44336;
    transform-origin: 0 50%;
    animation: auto grow-progress  linear forwards;
    animation-timeline: --scrollcontainer;
  }

  @keyframes grow-progress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
  }

  div{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 300px;
    height: 280px;
    flex-shrink: 0;
    margin: 10px;
    background-color: beige;
    color: coral;
    font-size: 80px;
  }

  div:nth-child(odd){
    background-color:wheat
  }
</style>
<main>
  <span></span>
  
  <div>欢</div>
  <div>迎</div>
  <div>关</div>
  <div>注</div>
  <div>白</div>
  <div>哥</div>
  <div>学</div>
  <div>前</div>
  <div>端</div>
</main>
